var xtDistrictWinAdd;
var xtDistrictFormAdd;
function addXtDistrict(xt_cityID){
	initXtDistrictFormAdd();
	Ext.getCmp('xt_districtUpID').setValue(xt_cityID);
	xtDistrictWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtDistrictFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtDistrictFormAdd,'../xtDistrictController/addXtDistrict',grid,xtDistrictWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtDistrictWinAdd.show();
}
function initXtDistrictFormAdd(){
	xtDistrictFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'县区名称',
			xtype:'textfield',
			name:'xt_districtName',
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'级上编号',
			xtype:'textfield',
			name:'xt_districtUpID',
			maxLength:32,
			hidden:true,
			id:'xt_districtUpID',
			anchor:'100%'
		},
		{
			fieldLabel:'',
			xtype:'numberfield',
			value:'0',
			hidden:true,
			name:'xt_districtUpIdNum',
			anchor:'100%'
		},
		{
			fieldLabel:'路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;径',
			xtype:'textfield',
			name:'xt_districtPath',
			maxLength:100,
			anchor:'100%'
		},
		{
			fieldLabel:'类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型',
			xtype:'textfield',
			name:'xt_districtType',
			maxLength:200,
			hidden:true,
			anchor:'40%'
		},
		{
			fieldLabel:'',
			xtype:'numberfield',
			value:'0',
			hidden:true,
			name:'xt_districtTypeNum',
			anchor:'100%'
		},
		{
			fieldLabel:'简&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;写',
			xtype:'textfield',
			name:'xt_districtShortName',
			maxLength:11,
			anchor:'40%'
		},
		{
			fieldLabel:'拼&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;音',
			xtype:'textfield',
			name:'xt_districtSpell',
			maxLength:11,
			anchor:'40%'
		},
		{
			fieldLabel:'',
			xtype:'textfield',
			name:'xt_districtAreaId',
			maxLength:11,
			hidden:true,
			anchor:'100%'
		},
		{
			fieldLabel:'邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编',
			xtype:'textfield',
			name:'xt_districtPostCode',
			maxLength:11,
			anchor:'40%'
		}
		]
	});
}
